import PreviewItem from '@/components/preview/video.vue';

const PreviewVideo = {};

// 注册
PreviewVideo.install = function (Vue) {
  const PreviewConstructor = Vue.extend(PreviewItem);
  const instance = new PreviewConstructor();
  instance.$mount(document.createElement("div"));
  document.body.appendChild(instance.$el);

  /**
   * 挂载在vue原型上
   * @param {Array} imgs 需要预览的图片数组
   */
  Vue.prototype.$openPreviewVideo = function (file_url) {
    instance.previewUrl = file_url;
    instance.dialogVisible = true;
  };
};

export default PreviewVideo;